package com.thread.test20190330.part1.simulatebackqueue05;

/**
 *
 * 模拟银行抽号排队系统
 *
 * @author Conceit
 * @since 1.0.0, 2019/4/1
 */
public class Back {

	public static void main(String[] args) {
		//executeThread();
		executeRunnable();

	}

	public static void executeThread(){
		ThreadLotteryMachine threadLotteryMachine1 =new ThreadLotteryMachine("threadLotteryMachine1");
		ThreadLotteryMachine threadLotteryMachine2 =new ThreadLotteryMachine("threadLotteryMachine2");
		ThreadLotteryMachine threadLotteryMachine3 =new ThreadLotteryMachine("threadLotteryMachine3");

		threadLotteryMachine1.start();
		threadLotteryMachine2.start();
		threadLotteryMachine3.start();
	}

	public static void executeRunnable(){
		RunnableLotteryMachine runnableLotteryMachine=new RunnableLotteryMachine();
		Thread runnableLotteryMachine1=new Thread(runnableLotteryMachine,"runnableLotteryMachine1");
		Thread runnableLotteryMachine2=new Thread(runnableLotteryMachine,"runnableLotteryMachine2");
		Thread runnableLotteryMachine3=new Thread(runnableLotteryMachine,"runnableLotteryMachine3");

		runnableLotteryMachine1.start();
		runnableLotteryMachine2.start();
		runnableLotteryMachine3.start();
	}

}
